<?php


namespace App\Model;


use Hyperf\Database\Model\Relations\HasOne;

class GroupUser extends Model
{
    protected $fillable = ['user_id', 'group_id', 'node', 'type', 'state'];

    public function user(): HasOne
    {
        return $this->hasOne(User::class, 'id', 'user_id');
    }

    public function group(): HasOne
    {
        return $this->hasOne(Group::class, 'id', 'group_id');
    }
}